import request from '@/utils/request'
import {
	encrypt,
	decrypt
} from "@/utils/jsencrypt.js";



//创建预约看房订单
export function visitorCreate(query) {
	return request({
		url: '/app/order/visitor/create',
		method: 'post',
		params: query
	})
}

//取消预约看房订单
export function visitorCancel(query) {
	return request({
		url: '/app/order/visitor/cancel',
		method: 'post',
		params: query
	})
}

//预约看房订单列表
export function orderList(query) {
	return request({
		url: '/app/order/list',
		method: 'get',
		params: query
	})
}

//预约看房订单详情
export function getInfo(query) {
	return request({
		url: '/app/order/getInfo',
		method: 'get',
		params: query
	})
}

//查询房源临时密码
export function getOrderPwd(id) {
	return request({
		url: `/app/order/getOrderPwd/${id}`,
		method: 'get',
	})
}

//保存密码
export function saveLockPsw(id, query) {
	return request({
		url: `/app/order/saveLockPsw/${id}`,
		method: 'get',
		params: query
	})
}


//预定房源接口开始
//创建预定订单
export function YDvisitorCreate(query) {
	return request({
		url: '/app/order/predetermine/create',
		method: 'post',
		params: query
	})
}
//取消预定
export function predetermineCancel(query) {
	return request({
		url: '/app/order/predetermine/cancel',
		method: 'post',
		params: query
	})
}
//获取验证码
export function verificationCode(query) {
	return request({
		url: '/api/sms/verificationCode',
		method: 'get',
		params: query
	})
}
//支付成功回调
export function paySuccessService(id) {
	return request({
		url: `/app/order/paySuccess?orderId=${id}`,
		method: 'get',
	})
}
//退定金
export function paySrefundDeposit(query) {
	return request({
		url: '/app/order/predetermine/refundDeposit',
		method: 'post',
		params: query
	})
}
//预定房源接口结束